<template>
	<div>
		<el-row class="state-row">
			<el-col :span="3">
				<div class="grid-content grid-flex">
					<i class="el-icon-s-operation icon-menu"></i>
				</div>
			</el-col>
			<el-col :span="3" :offset="18">
				<div class="grid-content grid-flex">
					<i class="el-icon-s-tools icon-menu"></i>
				</div>
			</el-col>
		</el-row>
		<div class="state-mian">
			<el-tabs v-model="activeName" @tab-click="handleClick">
				<el-tab-pane label="全部" name="first"><All></All></el-tab-pane>
				<!-- <el-tab-pane label="个人" name="second">个人</el-tab-pane> -->
				<el-tab-pane label="发布" name="third"><Up></Up></el-tab-pane>
			</el-tabs>
			<!-- <div class="s-content">
				<div class="s-item">
					<div class="img">
						<img src="https://lain.bgm.tv/pic/user/m/000/34/42/344268.jpg?r=1585127038" >
					</div>
					<div class="right">
						<div class="info">
							<p>被原创动画杀麻了</p>
							<div class="up-info">
								<span>2分钟前</span>
								<span class="line">/</span>
								<span>补旧番</span>
								<span class="line">/</span>
								<span class="author">yuri</span>
							</div>
						</div>
						<div class="more">
							<i class="el-icon-more" @click="show = !show"></i>
							<div class="dislike" v-show="show">
								屏蔽
							</div>
						</div>
					</div>
				</div>
			</div> -->
			<!-- <img src="https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80" > -->	
		</div>
		<el-dialog
			title="提示"
			:visible.sync="dialogVisible"
			width="80%"
			:before-close="handleClose">
			<span>你还未登录，去登录</span>
			<span slot="footer" class="dialog-footer">
				<el-button @click="dialogVisible = false">取 消</el-button>
				<el-button type="primary" @click="sure">确 定</el-button>
			</span>
		</el-dialog>
		<Nav></Nav>
	</div>
</template>

<script>
import Nav from '../tabnav.vue'
import All from './all.vue'
import Up from './up.vue'
export default {
	name: 'State',
	data(){
		return{
			activeName: 'first',
			show:true,
			// 确认框
			dialogVisible: false,
			uplist:[]
		}
	},
	methods: {
		handleClick(tab, event) {
			console.log(tab, event);
			if(tab.name == 'third'){
				if(this.$store.state.user.name != null){
					console.log(this.$store.state.user.name) 
				}else{
					this.dialogVisible = true
					// this.$router.go(-1);
				}
			}
			// if(tab.name == 'first'){
				
			// }
		},
		handleClose() {
			this.dialogVisible = false
			// this.$router.go(-1);
		},
		sure(){
			this.$router.push({name:'Login'})
			this.dialogVisible = false
		},
	},
	components:{
		Nav,
		All,
		Up
	}
}
</script>

<style scoped='scoped' lang="scss">
	@import "state.scss";
	.s-tab{
		position: fixed !important;
		z-index: 99;
		margin-top: 10vw;
	}
</style>
